#include "character.h"

Character::Character(char appearance, int x, int y) :
  appearance_(appearance), x_(x), y_(y) {
}

char Character::display(WINDOW* w) {
  mvwaddch(w, y_, x_, appearance_);
}

int Character::xPos() const {
  return x_;
}

int Character::yPos() const {
  return y_;
}

char Character::appearance() const {
  return appearance_;
}

void Character::undoLastMove() {
  x_ = oldX_;
  y_ = oldY_;
}

void Character::move(int x, int y) {
  oldX_ = x_;
  oldY_ = y_;
  x_ = x;
  y_ = y;
}
